package io.p2p.stream.dispatch.model;

import common.core.constans.NatType;
import common.core.util.PropertiesUtil;
import java.util.concurrent.atomic.AtomicInteger;

public class ClientSharedModel {
    private static final String CONFIG_FILE = "config-dev.properties";

    public static String mainServerFirstIP = null;

    public static int mainServerFirstPort = 0;

    public static String mainServerSecondIP = null;

    public static int mainServerSecondPort = 0;

    public static String stunServerIP = null;

    public static int stunServerPort = 0;

    public static String turnServerFirstIP = null;

    public static int turnServerFirstPort = 0;

    public static String loginName = null;

    public static AtomicInteger checkNatCount;

    public static AtomicInteger natType = new AtomicInteger(NatType.Unknown);

    static {
        mainServerFirstIP = PropertiesUtil.getString("udp.main.server.first.ip");
        mainServerFirstPort = PropertiesUtil.getInt("udp.main.server.first.port");

        mainServerSecondIP = PropertiesUtil.getString("udp.main.server.second.ip");
        mainServerSecondPort = PropertiesUtil.getInt("udp.main.server.second.port");

        stunServerIP = PropertiesUtil.getString("udp.stun.server.ip");
        stunServerPort = PropertiesUtil.getInt("udp.stun.server.port");

        turnServerFirstIP =  PropertiesUtil.getString("udp.turn.server.first.ip");
        turnServerFirstPort = PropertiesUtil.getInt("udp.turn.server.first.port");

        checkNatCount = new AtomicInteger(PropertiesUtil.getInt("nat.check.count"));

    }
}
